package com.sc.nft.controller;

import com.sc.nft.annotation.UserLogin;
import com.sc.nft.entity.dto.WebApplicationRequirementDTO;
import com.sc.nft.entity.vo.WebApplicationRequirementVO;
import com.sc.nft.service.ApplicationRequirementService;
import com.sc.nft.sup.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/applicationRequirement")
@Api(tags = "审核条件")
public class ApplicationRequirementController {

    private final ApplicationRequirementService applicationRequirementService;


    @ApiOperation(value = "获取web的条件", notes = "获取web的条件", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @PostMapping(value = "/webApplicationRequirement", produces = MediaType.APPLICATION_JSON_VALUE)
    @UserLogin
    public Result<WebApplicationRequirementVO> webApplicationRequirement(@RequestBody WebApplicationRequirementDTO webApplicationRequirementDTO) {

        return Result.success(applicationRequirementService.webApplicationRequirementVo(webApplicationRequirementDTO.getType()));
    }
}
